<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
    <title>横屏/竖屏</title>
<style>
body{
    background-color:lightgreen;
}

@media only screen and (orientation:landscape){
    body{
        background-color:lightblue;
    }
}
</style>
</head>
<body>
<p>调整浏览器尺寸，当页面的宽度大于高度时，背景会变为浅蓝色，否则为浅绿色。</p>
</body>
</html>